<?php defined('IN_IA') or exit('Access Denied');?><?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('common/header', TEMPLATE_INCLUDEPATH)) : (include template('common/header', TEMPLATE_INCLUDEPATH));?>
<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('base/css', TEMPLATE_INCLUDEPATH)) : (include template('base/css', TEMPLATE_INCLUDEPATH));?>
<style type="text/css">
.share-msg-config{width:300px;height:135px;border:1px solid #eee;background:#fefefe;border-radius:2px;box-sizing:border-box;padding:8px;}
.share-msg-config-box{position:relative;height:100%;}
.share-msg-config-title{position:absolute;top:0;left:0;margin-right:0;font-size:18px;width:100%;height:50px;overflow:hidden;word-wrap:break-word;word-break:break-all;resize:none;border:none;background:inherit;outline:none;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;}
.share-msg-config-desc{position:absolute;bottom:0;left:0;width:calc(100% - 60px - 8px);height:60px;margin:0;color:#aaa;word-wrap:break-word;word-break:break-all;overflow:hidden;resize:none;border:none;background:inherit;outline:none}
.share-msg-config-cover{position:absolute;right:0;bottom:0;width:60px;height:60px;overflow:hidden;cursor:pointer;}
.share-msg-config-cover img{width:100%;height:100%;}
</style>
<style>
    .joininformation{border:1px solid #ccc;width:100%;padding:15px;float:left;margin-right:15px}
    .joininformation-settings{border:1px solid #ccc;width:270px;padding:15px;float:left;}
    .joininformation input{border:1px dotted #ccc;outline: none;}
    .joininformation-item{float:left}
    .joininformation-title, .joininformation-box, .joininformation-tip{display:inline-block;width:48%;box-sizing: border-box;cursor: pointer;}
    .joininformation-box{text-align: center}
    .joininformation-title{margin-right:1%}
    .joininformation-tip{width:99%}
    .joininformation-settings-name{display:inline-block;width:30%}
    .joininformation-settings-value{display:inline-block;width:59%}
    .joininformation-action{text-align: left}
    .joininformation-extend{float:left;text-align: center;margin-left:30px}
    .joininformation-extend input{text-align: center}
    .span-a{cursor: pointer;}
    .span-a:hover{color:#428bca}
    [v-cloak]{display:none}
    @keyframes blink {
        0% { border-color: rgba(30, 144, 255, 1) }
        50% { border-color: rgba(30, 144, 25, 0)}
        100% { border-color: rgba(30, 144, 255, 1) }
    }
    .blink{
        animation: blink 2s linear infinite
    }
</style>
<form action="<?php  echo aurl(5)?>" id="form" method="post" class="form-horizontal" enctype="multipart/form-data">
<input name="token" type="hidden" value="<?php  echo $_W['token'];?>" />
<input type="hidden" name="id" value="<?php  echo $row['id'];?>" />
<div>

    <!-- Nav tabs -->
    <ul class="nav nav-tabs" role="tablist">
        <li role="presentation" class="active"><a href="#base" aria-controls="base" role="tab" data-toggle="tab">基本信息</a></li>
        <li role="presentation"><a href="#extend" aria-controls="extend" role="tab" data-toggle="tab">扩展选项</a></li>
        <li role="presentation"><a href="#redpack" aria-controls="redpack" role="tab" data-toggle="tab">返利设置</a></li>
        <li role="presentation"><a href="#attract" aria-controls="attract" role="tab" data-toggle="tab">招商设置</a></li>
        <li role="presentation"><a href="#share" aria-controls="share" role="tab" data-toggle="tab">分享设置</a></li>
        <li role="presentation"><a href="#jim" aria-controls="jim" role="tab" data-toggle="tab">报名信息设置</a></li>
        <li role="presentation"><a href="#color" aria-controls="color" role="tab" data-toggle="tab">活动页面色调调整</a></li>
    </ul>

    <!-- Tab panes -->
    <div class="tab-content">
        <div role="tabpanel" class="tab-pane active" id="base">
            
            <?php  if($_W['role'] != 'clerk') { ?>
            <div class="form-group">
                <label class="col-sm-2 control-label text-right">显示状态：</label>
                <div class="col-sm-10">
                    <div class="btn-group" data-toggle="buttons">
                        <!-- <label class="btn btn-info <?php  if($row['status'] == 1) { ?> active<?php  } ?>">
                            <input type="radio" name="status" value="1" id="option1" autocomplete="off" <?php  if($row['status'] == 1) { ?>checked<?php  } ?>> 审核中
                        </label> -->
                        <label class="btn btn-info <?php  if($row['status'] == 2 || empty($row['status'])) { ?> active<?php  } ?>">
                            <input type="radio" name="status" value="2" id="option1" autocomplete="off" <?php  if($row['status'] == 2 || empty($row['status'])) { ?>checked<?php  } ?>> 正常
                        </label>
                        <label class="btn btn-info <?php  if($row['status'] == 3) { ?> active<?php  } ?>">
                            <input type="radio" name="status" value="3" id="option2" autocomplete="off" <?php  if($row['status'] == 3) { ?>checked<?php  } ?>> 关闭
                        </label>
                    </div>
                </div>
            </div>
            <?php  } ?>

            <div class="form-group">
                <label class="col-sm-2 control-label text-right">活动标题：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="title" value="<?php  echo $row['title'];?>">
                    <p class="help-block">* 标题最多40个字符</p>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label text-right">预付费：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control text-width-small" name="price" value="<?php  echo $row['price'];?>" <?php  if($_W['role'] == 'clerk' && !empty($row['id'])) { ?>disabled="disabled"<?php  } ?>> 元
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label text-right">过期时间：</label>
                <div class="col-sm-10 text-width-normal">
                    <?php  echo _tpl_form_field_date('end_time', $row['end_time'])?>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label text-right">关联客服：</label>
                <div class="col-sm-10">
                    <select class="form-control text-width-normal" name="service_user_id" <?php  if($_W['role'] == 'clerk') { ?>disabled="disabled"<?php  } ?>>
                        <option value="0" >请选择客服</option>
                        <?php  if(is_array($serviceUsers)) { foreach($serviceUsers as $user) { ?>
                        <option value="<?php  echo $user['id'];?>" <?php  if($row['service_user_id'] == $user['id'] || $_W['uid'] == $user['uid']) { ?>selected<?php  } ?>><?php  echo $user['name'];?></option>
                        <?php  } } ?>
                    </select>
                    <?php  if($_W['role'] == 'clerk') { ?>
                        <input type="hidden" name="service_user_id" value="<?php  echo $_W['uid'];?>">
                    <?php  } ?>
                    <p class="help-block">客服选定之后不能再修改</p>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label text-right">活动封面：</label>
                <div class="col-sm-10">
                    <?php  echo tpl_form_field_image('cover', $row['cover'])?>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label text-right">成团人数：</label>
                <div class="col-sm-10">
                    <?php  $group_map = json_decode($row['group_map'], true)?>
                    <table class="table table-bordered w360 map-line">
                        <tbody>
                        <tr>
                            <th>团购人数</th>
                            <th>团购价格（单价）</th>
                            <td width="16"><a href="javascript:void(0)" class="add-line">+</a></td>
                        </tr>
                        <?php  if(is_array($group_map)) { foreach($group_map as $map) { ?>
                        <tr>
                            <td><input type="text" class="form-control map-members" name="map_members[]" value="<?php  echo $map['members'];?>"></td>
                            <td><input type="text" class="form-control map-price" name="map_price[]" value="<?php  echo $map['price'];?>"></td>
                            <td><a href="javascript:void(0)" onclick="delline(this)">-</a></td>
                        </tr>
                        <?php  } } ?>
                        </tbody>
                    </table>
                    <p class="help-block">点击右上方加号添加列表，不填写不显示。</p>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label text-right">活动详情：</label>
                <div class="col-sm-10 limithigh">
                    <?php  echo tpl_ueditor('content', $row['content'])?>
                </div>
            </div>

        </div>
        <div role="tabpanel" class="tab-pane" id="extend">

            <div class="form-group">
                <label class="col-sm-2 control-label text-right">开启核销：</label>
                <div class="col-sm-10">
                    <select class="form-control text-width-normal" name="is_cav" id="is_cav">
                        <option value="1">关闭</option>
                        <option value="2" <?php  if($row['is_cav'] == 2) { ?>selected='selected'<?php  } ?>>开启</option>
                    </select>
                    <p class="help-block">* 核销功能需要配合附加模块【模块订单核销工具】使用。</p>
                </div>
            </div>
            
            <div class="form-group">
                <label class="col-sm-2 control-label text-right">背景音乐：</label>
                <div class="col-sm-10">
                    <?php  echo tpl_form_field_audio('bgm', $row['bgm'])?>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label text-right">背景音乐（支付后）：</label>
                <div class="col-sm-10">
                    <?php  echo tpl_form_field_audio('bgm2', $row['bgm2'])?>
                    <p class="help-block">如果不设置，支付后的背景音乐将不发生变化。</p>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label text-right">客服电话：</label>
                <div class="col-sm-10">
                    <input name="service_mobiles" class="form-control text-width-normal" value="<?php  echo $row['service_mobiles'];?>"> 
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label text-right">分享活动二维码：</label>
                <div class="col-sm-10">
                    <select class="form-control text-width-normal" name="design_status" id="design_status">
                        <option value="1">关闭</option>
                        <option value="2" <?php  if($row['design_status'] == 2) { ?>selected='selected'<?php  } ?>>开启</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label text-right">打开附近的团：</label>
                <div class="col-sm-10">
                    <select class="form-control text-width-normal" name="show_local_group" id="show_local_group">
                        <option value="1">关闭</option>
                        <option value="2" <?php  if($row['show_local_group'] == 2) { ?>selected='selected'<?php  } ?>>开启</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label text-right">团长邀请信息：</label>
                <div class="col-sm-10">
                    <input name="group_speak_info" class="form-control" value="<?php echo $row['group_speak_info'] ?: '%NAME%邀请你参与%ACTIVE%，抢到就是赚到！'?>"> 
                    <p class="help-block">
                        1. 内容支持替换符：<br>
                        2. 写入 %ACTIVE% ，将替换为活动名称；<br>
                        3. 写入 %HAVES% ，将替换为活动报名数量；<br>
                        4. 写入 %NAME% ，将替换为分享人报名姓名。<br>
                        7. 请注意：文字做多为150字，请注意替换符和文字的实际效果字数限制。
                    </p>
                </div>
            </div>
            
            <div class="form-group">
                <label class="col-sm-2 control-label text-right">活动玩法：</label>
                <div class="col-sm-10">
                    <?php  echo tpl_ueditor('method', $row['method'])?>
                </div>
            </div>
            
        </div>

        <div role="tabpanel" class="tab-pane" id="redpack" v-cloak>

            <div class="form-group">
                <label class="col-sm-2 control-label text-right">返利功能：</label>
                <div class="col-sm-10">
                    <select class="form-control text-width-normal" name="redpack_status" id="redpack_status" v-model="status">
                        <option value="1">开启</option>
                        <option value="2">关闭</option>
                    </select>
                    <p class="help-block">开启微信返利时，需要在微擎 平台-支付参数-退款配置-微信退款 中上传证书并保存</p>
                </div>
            </div>
            <template v-if="status == 1">
            <hr>
            <div id="show_redpack_config">
                <div class="form-group">
                    <label class="col-sm-2 control-label text-right">分享返利：</label>
                    <div class="col-sm-10">
                        <select name="open_share" v-model="open_share">
                            <option value="0">关闭分享返利&emsp;</option>
                            <option value="1">开启分享返利&emsp;</option>
                        </select>
                    </div>
                </div>
                <template v-if="open_share == 1">
                <div class="form-group">
                    <label class="col-sm-2 control-label text-right"></label>
                    <div class="col-sm-10">
                        客户
                        <select name="share_type" v-model="share_type">
                            <option value="1">无需支付&emsp;</option>
                            <option value="2">在报名后&emsp;</option>
                            <option value="3">在成功支付后&emsp;</option>
                        </select>
                        ，分享页面
                        <select name="share_value" v-model="share_value">
                            <option value="1">1</option>
                            <option value="2">2</option>
                            <option value="3">3</option>
                            <option value="4">4</option>
                            <option value="5">5</option>
                            <option value="6">6</option>
                            <option value="7">7</option>
                            <option value="8">8</option>
                            <option value="9">9</option>
                            <option value="10">10&emsp;</option>
                        </select>
                        次后可获得 
                        <input type="text" name="share_reward_min" class="form-control text-width-tiny align-center" value="<?php  echo $row['share_reward_min'];?>">
                        -
                        <input type="text" name="share_reward_max" class="form-control text-width-tiny align-center" value="<?php  echo $row['share_reward_max'];?>">
                        元
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label text-right"></label>
                    <div class="col-sm-10">
                        <select class="form-control text-width-normal" name="share_send_type" v-model="share_send_type" >
                            <option value="1">微信现金红包</option>
                            <option value="2" <?php  if($row['redpack_type'] == 2) { ?>selected='selected'<?php  } ?>>微信企业付款</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label text-right"></label>
                    <div class="col-sm-10">
                        <redpack v-if="share_send_type == 1" name="share" act="<?php  echo $row['share_pack_name'];?>" sender="<?php  echo $row['share_pack_sender'];?>" wishing="<?php  echo $row['share_pack_wishing'];?>" remark="<?php  echo $row['share_pack_remark'];?>"></redpack>
                        <transfers v-else-if="share_send_type == 2" name="share" remark="<?php  echo $row['share_pack_trans_remark'];?>"></transfers>
                    </div>
                </div>
                </template>

                <hr>

                <div class="form-group">
                    <label class="col-sm-2 control-label text-right">团员返利：</label>
                    <div class="col-sm-10">
                        <select name="open_member" v-model="open_member">
                            <option value="0">关闭团员返利&emsp;</option>
                            <option value="1">开启团员返利&emsp;</option>
                        </select>
                    </div>
                </div>
                <template v-if="open_member == 1">
                <div class="form-group">
                    <label class="col-sm-2 control-label text-right"></label>
                    <div class="col-sm-10">
                        任意用户
                        <select name="member_type" v-model="member_type">
                            <option value="1">无需支付&emsp;</option>
                            <option value="2">在报名后&emsp;</option>
                            <option value="3">在成功支付后&emsp;</option>
                        </select>
                        ，分享活动给朋友，朋友支付成功后用户可获得 
                        <input type="text" name="member_reward_min" class="form-control text-width-tiny align-center" value="<?php  echo $row['member_reward_min'];?>">
                        -
                        <input type="text" name="member_reward_max" class="form-control text-width-tiny align-center" value="<?php  echo $row['member_reward_max'];?>">
                        元
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label text-right"></label>
                    <div class="col-sm-10">
                        <select class="form-control text-width-normal" name="member_send_type" v-model="member_send_type">
                            <option value="1">微信现金红包</option>
                            <option value="2">微信企业付款</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label text-right"></label>
                    <div class="col-sm-10">
                        <redpack v-if="member_send_type == 1" name="member" act="<?php  echo $row['member_pack_name'];?>" sender="<?php  echo $row['member_pack_sender'];?>" wishing="<?php  echo $row['member_pack_wishing'];?>" remark="<?php  echo $row['member_pack_remark'];?>"></redpack>
                        <transfers v-else-if="member_send_type == 2" name="member" remark="<?php  echo $row['member_pack_trans_remark'];?>"></transfers>
                    </div>
                </div>
                </template>


                <hr>
                <div class="form-group">
                    <label class="col-sm-2 control-label text-right">团长成团返利：</label>
                    <div class="col-sm-10">
                        <select name="open_group" v-model="open_group">
                            <option value="0">关闭成团返利&emsp;</option>
                            <option value="1">开启成团返利&emsp;</option>
                        </select>
                    </div>
                </div>
                <template v-if="open_group == 1">
                <div class="form-group">
                    <label class="col-sm-2 control-label text-right"></label>
                    <div class="col-sm-10">
                        <select class="form-control text-width-normal" name="group_send_type" v-model="group_send_type">
                            <option value="1">微信现金红包</option>
                            <option value="2">微信企业付款</option>
                            <option value="3">实物礼品</option>
                        </select>
                    </div>
                </div>
                <div class="form-group" v-if="group_send_type == 1 || group_send_type == 2">
                    <label class="col-sm-2 control-label text-right"></label>
                    <div class="form-group col-sm-10">
                        <label class="col-sm-2 control-label text-right">红包金额：</label>
                        <div class="col-sm-10">
                            <input type="text" name="group_reward_min" class="form-control text-width-tiny align-center" value="<?php  echo $row['group_reward_min'];?>">
                            -
                            <input type="text" name="group_reward_max" class="form-control text-width-tiny align-center" value="<?php  echo $row['group_reward_max'];?>">
                            元
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label text-right"></label>
                    <div class="col-sm-10">
                        <redpack v-if="group_send_type == 1" name="group" act="<?php  echo $row['group_pack_name'];?>" sender="<?php  echo $row['group_pack_sender'];?>" wishing="<?php  echo $row['group_pack_wishing'];?>" remark="<?php  echo $row['group_pack_remark'];?>"></redpack>
                        <transfers v-else-if="group_send_type == 2" name="group" remark="<?php  echo $row['group_pack_trans_remark'];?>"></transfers>
                        <group-gift v-else-if="group_send_type == 3" name="group" gift="<?php  echo $row['group_gift_name'];?>"></group-gift>
                    </div>
                </div>
                </template>
            </div>
            </template>
        </div>

        <div role="tabpanel" class="tab-pane" id="attract">

            <div class="szxh-line">
                <span class="szxh-title">是否开启招商</span>
                <span class="szxh-setting">
                    <select name="attract_status" id="attract_status">
                        <option value="1" <?php  if($row['attract_status'] == 1) { ?>selected="selected"<?php  } ?>>开启&emsp;</option>
                        <option value="2" <?php  if($row['attract_status'] == 2) { ?>selected="selected"<?php  } ?>>关闭&emsp;</option>
                    </select>
                </span>
            </div>

            <div class="szxh-line">
                <span class="szxh-title">招商文字</span>
                <span class="szxh-setting">
                    <input type="text" class="form-control" name="attract_title" value="<?php echo $row['attract_title'] ?: '创建我的活动'?>">
                </span>
            </div>
            
            <div class="szxh-line">
                <span class="szxh-title">显示方式</span>
                <span class="szxh-setting">
                    <select name="attract_type" id="attract_type">
                        <option value="1" <?php  if($row["attract_type"] == 1) { ?>selected="selected"<?php  } ?>>客服二维码&emsp;</option>
                        <option value="2" <?php  if($row["attract_type"] == 2) { ?>selected="selected"<?php  } ?>>自定义跳转链接&emsp;</option>
                        <option value="3" <?php  if($row["attract_type"] == 3) { ?>selected="selected"<?php  } ?>>自定义内容&emsp;</option>
                    </select>
                </span>
            </div>

            <div class="szxh-line">
                <span class="szxh-title">自定义跳转链接</span>
                <span class="szxh-setting">
                    <input type="text" class="form-control" name="attract_value_link" value="<?php  echo $row['attract_value_link'];?>" placeholder="http(s)://">
                    <span class="help-block">显示方式选择自定义跳转链接时必填此项。</span>
                </span>
            </div>
            
            <div class="szxh-line">
                <span class="szxh-title">自定义内容</span>
                <span class="szxh-setting limithigh">
                    <?php  echo tpl_ueditor('attract_value_custom', $row['attract_value_custom'])?>
                    <span class="help-block">显示方式选择自定义内容时必填此项。</span>
                </span>
            </div>

        </div>

        <div role="tabpanel" class="tab-pane" id="share">

            <div class="form-group">
                <label class="col-sm-2 control-label text-right">分享设置：</label>
                <div class="col-sm-10">
                    <div class="share-msg-config"><div class="share-msg-config-box">
                        <textarea name="share_text" id="share_text" class="share-msg-config-title" placeholder="请填写分享标题"><?php echo $row['share_text'] ?: '我是%NAME%，我的团已有%HAVES%报名了，快来加入我们吧！'?></textarea>
                        <textarea name="share_desc" id="share_desc" class="share-msg-config-desc" placeholder="请填写分享描述"><?php echo $row['share_desc'] ?: '%ACTIVE%'?></textarea>
                        <div class="share-msg-config-cover share-msg-config-upload">
                            <img src="<?php  echo tomedia($row['share_image']);?>">
                            <input type="hidden" name="share_image" id="share_image" value="<?php  echo $active['share_image'];?>">
                        </div>
                    </div></div>
                    <p class="help-block">
                        1. 点击指定区域可以进行编辑<br>
                        2. 标题和简述的文字不能相同<br>
                        3. 名称和简述最多100个字符，不能和活动标题内容相同。标题支持替换符：<br>
                        4. 写入 %ACTIVE% ，将替换为活动名称；<br>
                        5. 写入 %HAVES% ，将替换为活动报名数量；<br>
                        6. 写入 %NAME% ，将替换为分享人报名姓名。<br>
                        7. <strong>请注意</strong>：文字如果超出显示区域，实际效果将会不显示超出的部分。
                    </p>
                </div>
            </div>

        </div>

        <div role="tabpanel" class="tab-pane" id="jim" v-cloak>
    
            <div class="szxh-line">
                <span class="szxh-title">开启信息采集</span>
                <span class="szxh-setting">
                    <select name="joininformation_status">
                        <option value="1" <?php  if($row['joininformation_status'] == 1) { ?>selected="selected"<?php  } ?>>开启&emsp;</option>
                        <option value="2" <?php  if($row['joininformation_status'] == 2) { ?>selected="selected"<?php  } ?>>关闭&emsp;</option>
                    </select>
                    &emsp; <a href="javascript:;" v-if="joininformation.length < 5" @click="addRow" style="margin-left:10px;text-decoration:underline;color:dodgerblue">增加</a>
                    <input type="hidden" name="joininformation" value='<?php  echo $row["joininformation"];?>' v-model="json"><br><br>
                    <label><input type="checkbox" value="1" v-model="useOpt"> 启用预设采集订单信息（姓名+电话）（与下方设置的自定义信息共存，请注意。）</label><br><br>
                </span>
                
            </div>
            <div class="szxh-line" v-if="joininformation.length > 0">
                
                <span class="szxh-title"></span>
                <span class="szxh-setting">
                <div class="joininformation">
                    <div v-for="jim in joininformation" v-if="jim.opt == false || jim.opt == undefined" style="margin-bottom:20px">
                        <div class="joininformation-item">
                            <div class="joininformation-line1">
                                <span class="joininformation-title"><input type="text" class="form-control" v-model="jim.name"></span>
                                <span class="joininformation-box"><label style="vertical-align:super"><input type="radio" value="1" v-model="jim.type"> 输入框形式</label></span>
                            </div>
                            <div class="joininformation-tip">
                                <input type="text" class="form-control" v-model="jim.placeholder" style="height:24px;margin:5px 0;color:#999">
                            </div>
                            <div class="joininformation-action">
                                <a href="javascript:;" style="font-size:12px;margin-left:10px;"
                                    @click="deleteRow(jim)">删除</a>
                            </div>
                        </div>
                        <div class="joininformation-extend">
                            <label style="line-height:10px;margin-bottom:22px"><input type="radio" value="2" v-model="jim.type"> 下拉菜单形式&emsp;<span class="span-a" @click="addSelect(jim)">添加</span></label>
                            <div style="text-align: center" v-for="select in jim.select">
                                <span><input type="text" v-model="select.name" placeholder="设置菜单内容"></span>
                                <!-- <span><label style="vertical-align: baseline;"><input type="checkbox" value="1" v-model="select.nopay"> 不需要支付</label></span> -->
                                <span><a href="javascript:;" @click="removeSelect(jim, select)">删除</a></span>
                            </div>
                        </div>
                        <div style="clear:both"></div>
                    </div>
                </div>
                </span>
            </div>
            
        
            <div class="szxh-line">
                <span class="szxh-title"></span>
                <span class="szxh-setting">
                    <p class="help-block">设置项目最多4个字，提示信息最多10个字。仅填写的项在活动页面展示。<br>
                        <strong style="color:red">请注意：以上填写内容均不支持输入字符“.”</strong></p>
                </span>
            </div>
            
        </div>
        
        <div role="tabpanel" class="tab-pane" id="color">
            
            <div class="form-group">
                <label class="col-sm-2 control-label text-right">板块标题背景颜色：</label>
                <div class="col-sm-10">
                    <?php echo tpl_form_field_color('color_head_bg', $row['color_head_bg'] ?: '#fe8b30')?>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label text-right">板块标题文字颜色：</label>
                <div class="col-sm-10">
                    <?php echo tpl_form_field_color('color_head_font', $row['color_head_font'] ?: '#ffffff')?>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label text-right">板块标题边框颜色：</label>
                <div class="col-sm-10">
                    <?php echo tpl_form_field_color('color_head_border', $row['color_head_border'] ?: '#777777')?>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label text-right">底部按钮背景颜色：</label>
                <div class="col-sm-10">
                    <?php echo tpl_form_field_color('color_button_bg', $row['color_button_bg'] ?: '#1e90ff')?>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label text-right">底部按钮文字颜色：</label>
                <div class="col-sm-10">
                    <?php echo tpl_form_field_color('color_button_font', $row['color_button_font'] ?: '#ffffff')?>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label text-right">倒计时文字颜色：</label>
                <div class="col-sm-10">
                    <?php echo tpl_form_field_color('color_countdown', $row['color_countdown'] ?: '#f60302')?>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label text-right">板块打底背景颜色：</label>
                <div class="col-sm-10">
                    <?php echo tpl_form_field_color('color_bround_bg', $row['color_bround_bg'] ?: '#f2cf1d')?>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label text-right">附近的团进度条颜色：</label>
                <div class="col-sm-10">
                    <?php echo tpl_form_field_color('color_progress_bg', $row['color_progress_bg'] ?: '#fe8b30')?>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label text-right">招商信息背景颜色：</label>
                <div class="col-sm-10">
                    <?php echo tpl_form_field_color('color_attract_bg', $row['color_attract_bg'] ?: '#fe8b30')?>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label text-right">招商信息文字颜色：</label>
                <div class="col-sm-10">
                    <?php echo tpl_form_field_color('color_attract_text', $row['color_attract_text'] ?: '#ffffff')?>
                </div>
            </div>

        </div>

    </div>
    <div class="szxh-line"><span class="szxh-title"></span><span class="szxh-setting"><button type="submit" class="btn btn-info">提交保存</button></span></div>

</div>
</form>

<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('base/js', TEMPLATE_INCLUDEPATH)) : (include template('base/js', TEMPLATE_INCLUDEPATH));?>

<script type="text/x-template" id="redpack_info">
<div>
    <div class="form-group">
        <label class="col-sm-2 control-label text-right">活动名称：</label>
        <div class="col-sm-10">
            <input type="text" class="form-control text-width-normal" :name="name+'_pack_name'" :value="act">
            <p class="help-block">* 不超过10个字</p>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label text-right">发送人名称：</label>
        <div class="col-sm-10">
            <input type="text" class="form-control text-width-normal" :name="name+'_pack_sender'" :value="sender">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label text-right">红包祝福语：</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" :name="name+'_pack_wishing'" :value="wishing">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label text-right">发放备注：</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" :name="name+'_pack_remark'" :value="remark">
        </div>
    </div>
</div>
</script>
<script type="text/x-template" id="transfers_info">
<div>
    <div class="form-group">
        <label class="col-sm-2 control-label text-right">转账备注信息：</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" :name="name+'_pack_trans_remark'" :value="remark">
        </div>
    </div>
</div>
</script>
<script type="text/x-template" id="groupGift">
<div>
    <div class="form-group">
        <label class="col-sm-2 control-label text-right">礼品名称：</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" :name="name+'_gift_name'" :value="gift">
        </div>
    </div>
</div>
</script>

<script>
    $('#form').on('submit', function(e) {

        var share_text = $('#share_text').val();
        var share_desc = $('#share_desc').val();

        if(share_text == share_desc) {
            xalert('分享标题和分享简述不能相同', false, true);
            return false;
        }

        var data = $(this).serialize();
        // TODO
        post('<?php  echo aurl(5)?>', data, function() {
            setTimeout(function() {
                location.href = "<?php  echo aurl(1)?>";
            }, 2000);
        });

        return false;
    });

    require(['vue'], function(Vue) {
        new Vue({
            el: '#redpack',
            data: {
                status: "<?php  echo $row['redpack_status'];?>" || "1",
                open_share: "<?php  echo $row['open_share'];?>" || "0",
                open_member: "<?php  echo $row['open_member'];?>" || "0",
                open_group: "<?php  echo $row['open_group'];?>" || "0",
                share_type: "<?php  echo $row['share_type'];?>" || "1",
                member_type: "<?php  echo $row['member_type'];?>" || "1",
                share_value: "<?php  echo $row['share_value'];?>" || "1",
                share_send_type: "<?php  echo $row['share_send_type'];?>" || "1",
                member_send_type: "<?php  echo $row['member_send_type'];?>" || "1",
                group_send_type: "<?php  echo $row['group_send_type'];?>" || "1"
            },
            components: {
                "redpack": {
                    props: ['name','act','sender','wishing','remark'],
                    data: function() {return {}},
                    template: '#redpack_info'
                },
                'transfers': {
                    props: ['name','remark'],
                    data: function() {return {}},
                    template: '#transfers_info'
                },
                'group-gift': {
                    props: ['name','gift'],
                    data: function() {return {}},
                    template: '#groupGift'
                }
            }
        });
    });

    function changeType(e) {
        if(e.value == 2) {
            $('#selectAttr').hide();
        } else {
            $('#selectAttr').show();
        }
    }

    $(function() {
        $('.add-line').on('click', function() {
            $(this).parents('tbody').append('<tr>\
                <td><input type="text" class="form-control map-members" name="map_members[]"></td>\
                <td><input type="text" class="form-control map-price" name="map_price[]"></td>\
                <td><a href="javascript:void(0)" onclick="delline(this)">-</a></td>\
            </tr>');
        })
    })
    function delline(e) {
        $(e).parents('tr').empty();
    }

    $(function() {
        $('.share-msg-config-upload').on('click', function() {
            util.image('<?php  echo tomedia($row["share_image"]);?>', function(e) {
                $('.share-msg-config-cover img').prop('src', util.tomedia(e.attachment));
                $('#share_image').val(e.attachment);
            })
        });
    });

    require(['vue'], function(Vue) {
        function conversionJson(data) {
            try {
                return JSON.stringify(data);
            } catch (error) {
                return '';
            }
        }
        new Vue({
            el: '#jim',
            data: {
                joininformation: '',
                json: '<?php  echo $row["joininformation"];?>',
                useOpt: false,
                opt1: {"name":"您的姓名","placeholder":"您的真实姓名","type":1,"select":[{"name":"","nopay":false}],'opt':'name'},
                opt2: {"name":"手机号码","placeholder":"11位手机号码","type":1,"select":[{"name":"","nopay":false}],'opt':'mobile'},
            },
            mounted: function() {
                try {
                    this.joininformation = JSON.parse(this.json);
                } catch (error) {
                    this.joininformation = [];
                }
                if(this.json == '') {
                    this.useOpt = true;
                }
                for(var i in this.joininformation) {
                    if(this.joininformation[i].opt != false) {
                        this.useOpt = true;
                        break;
                    }
                }
            },
            methods: {
                deleteRow: function(el) {
                    this.joininformation.splice(this.joininformation.indexOf(el), 1);
                },
                addRow: function() {
                    this.joininformation.push({
                        name: '',
                        placeholder: '',
                        type: 1,
                        select: [
                            {name: '',nopay: false,value:''},
                        ],
                        opt: false
                    });
                },
                addSelect: function(jim) {
                    if(jim.select.length > 15) {
                        alert('最多添加15项');
                        return false;
                    }
                    jim.select.push({
                        name: '',
                        nopay: false,
                        value: ''
                    });
                },
                removeSelect: function(jim, select) {
                    if(jim.select.length == 1) {
                        alert('至少保留1项');
                        return;
                    }
                    jim.select.splice(jim.select.indexOf(select), 1);
                }
            },
            watch: {
                useOpt: function(val) {
                    if(this.joininformation.length > 0) {
                        for(var i = this.joininformation.length - 1; i >= 0; i--) {
                            if(this.joininformation[i].opt != false) {
                                this.joininformation.splice(this.joininformation.indexOf(this.joininformation[i]), 1);
                            }
                        }
                    }
                    if(val) {
                        this.joininformation.unshift(this.opt2);
                        this.joininformation.unshift(this.opt1);
                    }
                },
                joininformation: {
                    handler(newValue, oldValue) {
                        for(var jim in newValue) {
                            if(newValue[jim].opt != false) {
                                this.opt = true;
                                break;
                            }
                        }
                        this.json = conversionJson(this.joininformation);
                    },
                    deep: true
                }
            }
        });
    });

</script>

<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('common/footer', TEMPLATE_INCLUDEPATH)) : (include template('common/footer', TEMPLATE_INCLUDEPATH));?>